/*
Copyright (c) [2019年5月1日] [吴超]
[MBT_studio] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
		 http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
*/
#include "stdafx.h"
#include "灯光.h"



S_LigthParallel* f_ob_calloc平行光() {
	S_LigthParallel* data = (S_LigthParallel*)malloc(sizeof(S_LigthParallel));
	data->m_color = { 1,1,1 };
	data->m_dir = { 0,-1,0 };
	data->m_falloff = 0;
	data->m_intensity = 1;
	data->m_diffusivity = 0.5;
	return data;
}

S_LigthSpot* f_ob_calloc聚光灯() {
	S_LigthSpot* data = (S_LigthSpot*)malloc(sizeof(S_LigthSpot));
	data->m_dir = { 0,-1,0 };
	data->m_pos = { 0,1,0 };
	data->m_falloff = 0;
	data->m_intensity = 1;
	data->m_diffusivity = 0.5;
	return data;
}

S_LigthPoint* f_ob_calloc点光源() {
	S_LigthPoint* data = (S_LigthPoint*)malloc(sizeof(S_LigthPoint));
	data->m_pos = { 0,0,0 };
	data->m_intensity = 1;
	data->m_falloff = 0;
	return data;
}

S_LigthArea* f_ob_calloc区域光() {
	S_LigthArea* data = (S_LigthArea*)malloc(sizeof(S_LigthArea));
	data->m_dir = { 0,-1,0 };
	data->m_falloff = 0;
	data->m_intensity = 1;
	data->m_color = { 1,1,1 };
	data->m_diffusivity = 0.2;
	return data;
}



